package com.ecoolex.ying.space.ws;

import java.util.List;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import com.ecoolex.framework.common.exception.BizException;
import com.ecoolex.framework.common.pojo.Page;
import com.ecoolex.framework.common.pojo.Pagination;
import com.ecoolex.ying.space.core.manager.UserWorksMarktingDetailManager;
import com.ecoolex.ying.space.core.manager.UserWorksMarktingManager;
import com.ecoolex.ying.space.entity.UserWorksMarkting;
import com.ecoolex.ying.space.entity.UserWorksMarktingDetail;
import com.ecoolex.ying.space.pojo.AddUserWorksMarktingDetailDTO;

@Service
public class UserWorksMarktingServiceImpl implements UserWorksMarktingService{
	
	@Autowired
	private UserWorksMarktingManager userWorksMarktingManager;

	@Override
	public UserWorksMarkting get(Integer marktingId) {
		return userWorksMarktingManager.get(marktingId);
	}

	@Override
	public Pagination<UserWorksMarkting> query(Page page) {
		return userWorksMarktingManager.query(page);
	}

	@Override
	public UserWorksMarkting add(UserWorksMarkting record, String createUser) throws BizException {
		return userWorksMarktingManager.add(record, createUser);
	}

	@Override
	public UserWorksMarkting edit(UserWorksMarkting record, String updateUser) throws BizException {
		return userWorksMarktingManager.edit(record, updateUser);
	}

	@Override
	public void deleteMarkting(UserWorksMarkting record, String updateUser) throws BizException {
		userWorksMarktingManager.deleteMarkting(record, updateUser);
	}

	@Autowired
	private UserWorksMarktingDetailManager detailManager;
	
	@Override
	public UserWorksMarktingDetail getDetail(Integer id) {
		return detailManager.getDetail(id);
	}

	@Override
	public UserWorksMarktingDetail getByMarktingIdAndWorksId(Integer marktingId, Integer worksId) {
		return detailManager.getByMarktingIdAndWorksId(marktingId, worksId);
	}
	
	@Override
	public Pagination<UserWorksMarktingDetail> queryDetailByMarktingId(Integer marktingId, Page page) {
		return detailManager.queryDetailByMarktingId(marktingId, page);
	}

	@Override
	public void addDetail(Integer marktingId, List<AddUserWorksMarktingDetailDTO> detailList, String createUser) throws BizException {
		detailManager.addDetail(marktingId, detailList, createUser);
	}

	@Override
	public void editDetail(UserWorksMarktingDetail record, String updateUser) throws BizException {
		detailManager.editDetail(record, updateUser);
	}

	@Override
	public void delDetail(UserWorksMarktingDetail record, String updateUser) throws BizException {
		detailManager.delDetail(record, updateUser);
	}

}
